import React, {Component} from 'react';
import './index.less';
import {withRouter} from "react-router-dom";
import {reqStatistics} from '../../../../api/index';

/*首页中部组件*/

class body extends Component {
 state = {
        company_count:0,
        recruit_count: 0,
        employee_count: 0,
        order_count: 0,
        position_count: 0
    }

    //异步获取公司基本信息

    getCompanyInformation = async () => {

        //发异步ajax请求，获取数据
        const result = await reqStatistics()
        const {company_count,recruit_count,employee_count,position_count} = result.data.data

        //更新状态
        this.setState({
            company_count,
            recruit_count,
            employee_count,
            position_count
        })
    }

    //发异步ajax请求
    componentDidMount() {
        this.getCompanyInformation()
    }



    render() {
     const{company_count,recruit_count,employee_count,position_count}=this.state

        return (
            <div className="banner">
                <div className="banner1" style={{height:900}}>
                    <div className="slogan-wrap1">
                        <h2 className="slogan-wrap1-title">最专业的技术工人招聘服务提供商</h2>
                        <div className="slogan-wrap1-content">
                            <h2>真诚</h2><h2 >信任</h2><h2>进步</h2>
                        </div>
                    </div>
                </div>
                <div id="banner2" className="banner2" style={{height:920}}>
                    <div className="slogan-wrap2">
                        <div className="slogan-wrap2-title1">合作公司<h1 style={{fontSize:100,color:"red",textAlign:"center"}}>{company_count}</h1>家</div>
                        <div className="slogan-wrap2-title2">招聘岗位<h1 style={{fontSize:100,color:"red"}}>{recruit_count}</h1>个</div>
                    </div>
                </div>
                <div id="banner3" className="banner3" style={{height:900}}>
                    <div className="slogan-wrap3">
                      <div className="slogan-wrap3-title1">工作种类<h1 style={{fontSize:100,color:"red"}}>{position_count}</h1>个</div>
                        <div className="slogan-wrap3-title2" >求职者人数<h1 style={{fontSize:100,color:"red"}}>{employee_count}</h1>人</div>
                    </div>
                </div>
                <div id="banner4" className="banner4" style={{height:900}}>
                    <div className="slogan-wrap4">
                        <h2 className="slogan-wrap4-title">产品服务内容</h2>
                        <div className="slogan-wrap4-content">
                            <h2>1.免费使用德利求职小程序</h2>
                            <h2>2.优质的招聘外包服务</h2>
                            <h2>3.工程承包服务</h2>
                        </div>
                    </div>
                </div>
                <div id="banner5" className="banner5" style={{height:641}}>
                </div>
            </div>
        )
    }
}

export default withRouter(body)